<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <title>Login</title>
    </h:head>
    <h:body>
        <h1>Login</h1>
        <hr />
        <h:form>
            <h:commandButton action="#{usuarioBean.novo}" value="Registre-se" />
        </h:form>
        <hr />

        <h:panelGroup rendered="#{!empty param.login_error}">
            <span style="font-color:red">Erro ao efetuar o Login.</span><br />
            <br/>
            Motivo:#{SPRING_SECURITY_LAST_EXCEPTION.message}
        </h:panelGroup>

        <form id="login" method="post" action="#{request.contextPath}/j_spring_security_check">
            <table>
                <tr>
                    <td>Login</td>
                    <td><input type="text" name="j_username"/></td>
                </tr>
                <tr>
                    <td>Senha</td>
                    <td><input type="password" name="j_password"/></td>
                </tr>
                <tr>
                    <td align="right"><input type="checkbox" name="_spring_security_remember_me"/></td>
                    <td>Entrar automaticamente</td>
                </tr>
                <tr><td></td>
                    <td>
                        <input type="submit" value="Entrar"/>
                    </td>
                </tr>
            </table>
            <script>
                document.getElementById("login").j_username.value = "#{SPRING_SECURITY_LAST_USERNAME}";
            </script>
        </form>
    </h:body>
</html>